package com.codingapi.websocket.core.handler;

import com.codingapi.websocket.core.client.WebSocketSession;
import io.netty.handler.codec.http.websocketx.WebSocketFrame;

/**
 * @author modificial
 * @date 2018/7/19
 * @company codingApi
 * @description websocket接口
 */
public interface WebSocketHandler {

    void beforeConnectionUpgraded(WebSocketSession webSocketSession) throws Exception;

    void afterConnectionEstablished(WebSocketSession webSocketSession) throws Exception;

    void handleMessage(WebSocketSession webSocketSession, WebSocketFrame webSocketFrame) throws Exception;

    void handleTransportError(WebSocketSession webSocketSession, Throwable throwable) throws Exception;

    void afterConnectionClosed(WebSocketSession webSocketSession) throws Exception;

    boolean supportsPartialMessages();

}
